package com.baitiaojun.common.exception;

import com.baitiaojun.common.constants.HttpStatus;
import com.baitiaojun.common.enums.impl.ServerExpEnums;

/**
 * 系统异常
 */
public class ServerException extends GlobalException {

    public ServerException() {
        super();
    }

    public ServerException(ServerExpEnums serverExpEnums) {
        super(new ErrorCode(serverExpEnums));
    }

    public ServerException(ErrorCode errorCode) {
        super(errorCode);
    }

    public ServerException(String message) {
        super(HttpStatus.ERROR, message);
    }

    public ServerException(Integer code, String message) {
        super(code, message);
    }

    public ServerException setCode(Integer code) {
        return (ServerException) super.setCode(code);
    }

    public ServerException setMessage(String message) {
        return (ServerException) super.setMessage(message);
    }

    public Integer getCode() {
        return super.getCode();
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }
}
